﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TextDungeon
{
    public enum CreatureType :byte //make it possible to store data of a creature
    {
        Human, Animal, Magical, Elven, Orcish, Mystical
    }
    /// <summary>
    /// creatures holds the data of all creatuers Damage, hp, sp, mp relavent to ist skill, attribute, level and creature type
    /// </summary>
    class Creatures : Entity
    {
        public int hp;
        public int sp;
        public int mp;
        public byte level;
        public string name;
        public Skills skills;
        public Attributes attributes;
        


        public Creatures(char c,Position pos,CreatureType type ,byte level = 1) : base(c,pos, EntityType.Creature) 
        {
            this.pos = pos;
        }

        private void Creature(CreatureType ct) 
        {
            /*
            switch (ct)
            {
                case CreatureType.Animal: // low level creature commonly weak but endurant
                    hp = 50;
                    sp = 100;
                    mp = 0;
                    skills.attack = 15;
                    skills.unarmed = 20;

                    attributes.Strength = 6;
                    attributes.Agillity = 7;
                    attributes.Endurance = 10;
                    break;
                case CreatureType.Elven: // elvens are agile and magical a medium leveled creature
                    hp = 100;
                    sp = 70;
                    mp = 200;

                    skills.magic = 20;
                    skills.lightarmor = 20;
                    skills.ranged = 10;
                    skills.defence = 10;

                    attributes.Agillity = 8;
                    attributes.Intelligence = 7;
                    attributes.Endurance = 6;
                    break;
                case CreatureType.Human: // a commmon creature, exist in all levels but generally quite weak if not geared
                    hp = 100;
                    sp = 50;
                    mp = 50;

                    skills.attack = 20;
                    skills.blade = 15;
                    skills.axe = 10;
                    skills.defence = 15;
                    skills.lightarmor = 20;
                    skills.mediumarmor = 20;
                    skills.Heavyarmor = 25;

                    attributes.Charistma = 7;
                    attributes.Endurance = 6;
                    break;
                case CreatureType.Magical: //magical creatures that are nothing but magic are fearfully strong in magic and a high level creature 
                    hp = 20;
                    sp = 100;
                    mp = 100;

                    skills.magic = 255;
                    attributes.Intelligence = 50;
                    break;
                case CreatureType.Mystical: //who knows what these are, they might as well be a dragon too a golem. they are bosses or  very high level creatures
                    hp = 1000;
                    mp = 2000;
                    sp = 100;

                    skills.magic = 50;
                    skills.defence = 50;
                    attributes.Strength = 10;
                    attributes.Willpower = 20;
                    break;
                case CreatureType.Orcish: //orcs will take a lot of beating and deal a lot of damage over a small period of time, medium leveled creature
                    hp = 200;
                    sp = 50;
                    mp = 0;

                    skills.axe = 15;
                    skills.blunt = 20;
                    skills.spear = 10;
                    skills.mediumarmor = 10;
                    attributes.Willpower = 10;
                    attributes.Endurance = 10;
                    attributes.Strength = 10;
                    break;
            }
            */
        }
        private void LevelCallculate(byte level) 
        {
            hp *= 2;
            sp *= 2;
            mp *= 2;

            skills.attack += (byte)(5d * (double)(level / (10+level/3)));
            skills.defence += (byte)(5d * (double)(level / (10+level/3)));
            
        }
    }
}
